import TemplateCode.ConcreteSubject;
import TemplateCode.ProgressBarObserver;
import TemplateCode.Subject;
import TemplateCode.TextBoxObserver;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class Main {

    private static Logger logger = LogManager.getLogger(Main.class.getName());

    public static void main(String[] args) {
        System.out.println("------------观察者模式-模版-并写入日志-----------------");

        Subject subjectDeathNo = new ConcreteSubject();

        subjectDeathNo.addObserver(new TextBoxObserver());
        logger.debug("TextBoxObserver操作成功");
        subjectDeathNo.addObserver(new ProgressBarObserver());
        logger.debug("ProgressBarObserver操作成功");
        subjectDeathNo.addObserver(new TextBoxObserver());
        logger.debug("TextBoxObserver操作成功");

        subjectDeathNo.notifyObserver();


    }
}